<div class="breadcrumb d-flex align-items-center px-3 js-scroll">
    <div class="btn btn-icon me-3 js-back" aria-label="返回" role="button" tabindex="0">
        <i class="iconfont icon-left-arrow"></i>
    </div>
    <h2 class="fs-18"><?= $user->username ?></h2>
</div>

<?php include '_user_edit.php' ?>

<div class="auth-form mx-auto p-4 text-center">
    <form class="needs-validation" action="/user/photo" id="avatar-form" method="post" enctype="multipart/form-data">
        <input type="hidden" name="csrf_token" value="<?= csrf_token() ?>">
        <p class="mb-3">
            <img class="rounded-circle" id="previewImg" src="/img/avatar.jpg" alt="" style="width:120; height:120">
        </p>
        <input class="d-none" type="file" name="userAvatar" id="userAvatar" accept="image/png,image/jpeg,image/gif">
        <button type="button" id="submitButton" class="btn btn-secondary">
            <label for="userAvatar" class="cursor-pointer">选择图片</label>
        </button>
        <!-- <button type="submit" class="btn btn-secondary w-100 auth-btn px-0">修改密码</button> -->
    </form>
</div>

<script>
    document.addEventListener("DOMContentLoaded", (e) => {
        // 当前链接添加 active
        highlightActiveLink("user");
        document.getElementById("my-avatar").classList.add('active');
    });
</script>
